package com.example.kami.test;


import com.alibaba.fastjson.JSON;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.LinkedHashMap;


/**
 * @author liuhang
 * @description 云享阅读 (v1:不需要卡密，v2:需要卡密)
 * @date 2022/02/09
 */
@RestController
@RequestMapping("/yxyd")
public class YxydController {
    Logger log = LoggerFactory.getLogger(YxydController.class);

    @RequestMapping(value = "/v1/login")
    public String login() {
        LinkedHashMap map = new LinkedHashMap();
        LinkedHashMap map1 = new LinkedHashMap();
        map1.put("codeStatus", "已激活");
        map1.put("activeTime", "2022-03-13 23:59:59");
        map1.put("endTime", "2023-03-13 23:59:59");
        map1.put("type", "年卡");
        map1.put("dateDiffSecond", 25919779);

        map.put("code", 200);
        map.put("success", true);
        map.put("msg", "操作成功");
        map.put("data", map1);

        log.info("云享阅读登录成功！");
        return JSON.toJSONString(map);
    }

    @RequestMapping(value = "/v1/login1")
    public String login1() {
        LinkedHashMap map = new LinkedHashMap();
        LinkedHashMap map1 = new LinkedHashMap();
        map1.put("expirytime", 1944298598);

        map.put("code", 200);
        map.put("message", "操作成功");
        map.put("data", "");

        log.info("保护生态登录成功！");
        return JSON.toJSONString(map);
    }
}
